<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="j" uri="/struts-jquery-tags" %>

<html>
	<head>
		<title>Detail Person Data</title>
	</head>
<body>
<table bgcolor="#e4e4e4" border="0" cellpadding="3" cellspacing="1"	align="center">
	<tr>
		<td bgcolor="#ffffff" colspan="4"><s:a action="person">Person List</s:a></td>
	</tr>
	<tr bgcolor="#d0dcff">
        <td colspan="3">
        	<strong>Person Detail</strong>
        </td>
        <td>
        	<strong>Photo</strong>
        </td>
        <td colspan="2">

        </td>
    </tr>
	<tr>
		<td bgcolor="#d0dcff" width="100">First Name</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff" width="300">${firstName}</td>
		<td rowspan="15" align="center" valign="middle"><img src="<%= request.getContextPath() %>/person/${id}/photo" width="200"></td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Last Name</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${lastName}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Birthdate</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff"><s:property value="birthDate" /></td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Sex</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${male ? "Male" : "Female"}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Father</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">
			<s:a action="person/%{father.id}">
				<s:property value="father.firstName" /> <s:property value="father.lastName" />
			</s:a>
			<s:url id="fa" action="parent/%{id}/f" />
			<a href="#" onclick="javascript:window.open('${fa}','cats','scrollbars=yes,status=no,width=500,height=600'); return false;">(Change)</a>
		</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Mother</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">
			<s:a action="person/%{mother.id}">
				<s:property value="mother.firstName" /> <s:property value="mother.lastName" />
			</s:a>
			<s:url id="fa" action="parent/%{id}/m" />
			<a href="#" onclick="javascript:window.open('${fa}','cats','scrollbars=yes,status=no,width=500,height=600'); return false;">(Change)</a>
		</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Status</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff"><s:property value="status"/></td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Address</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${address}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">City</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${city}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">State</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${state}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Country</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${country}</td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Email</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff"><a href="mailto:${email}">${email}</a></td>
	</tr>
	<tr>
		<td bgcolor="#d0dcff">Mobile</td>
		<td bgcolor="#ffffff">:</td>
		<td bgcolor="#ffffff">${mobile}</td>
	</tr>
</table>

<br></br>
<br></br>

		<table border="0" cellpadding="3" cellspacing="1" align="center">
			<!-- form action="$person.id/child" method="post" -->
			<tr bgcolor="#d0dcff">
				<td colspan="3">Child(s) :</td>
			</tr>
			<!--  /form -->

			<tr bgcolor="#e4e4e4">
				<td align="center" width="300">Child</td>
				<td align="center" colspan="2">Action</td>
			</tr>
			<s:iterator var="c" value="childs">
			<tr bgcolor="#ffffff">
				<td>${c.firstName} ${c.lastName}</td>
				<td width="100" align="center">
					<s:url id="detail" action="person/%{id}" />
					<a href="${detail}">Detail</a>
				</td>
				<td width="100" align="center">
					<s:url id="remove" action="parent/%{id}/rmC?cid=" />
					<a href="#" onclick="javascript:window.open('${remove}${c.id}','cats','scrollbars=yes,status=no,width=500,height=600'); return false;">Remove</a>
				</td>
			</tr>
			</s:iterator>
			<tr bgcolor="#e4e4e4">
				<td colspan="3" align="right">
					<s:url id="child" action="parent/%{id}/c" />
					<a href="#" onclick="javascript:window.open('${child}','cats','scrollbars=yes,status=no,width=500,height=600'); return false;">Add child +</a>
				</td>
			</tr>
		</table>
</body>
</html>


